<template>
  <van-nav-bar title="广而告之" safe-area-inset-top left-arrow @click-left="onClickLeft" fixed v-if="!$router.currentRoute.value.query.adv" />
  <div class="iframe">
    <Overlay :show="show" />
    <div class="scroll-wrapper">
      <iframe :src="url" frameborder="0" width="100%" height="100%" @load="loading" style="vertical-align：bottom; display:block"></iframe>
    </div>
  </div>

</template>

<script lang='ts'>
import { reactive, toRefs } from "vue";
import $router from "../router/index";
import Overlay from "../components/Home/Overlay.vue";

export default {
  name: " ",
  components: {
    Overlay,
  },
  setup() {
    const data = reactive({
      url: $router.currentRoute.value.query.url,
      show: true,
    });
    const loading = () => {
      data.show = false;
    };

    const onClickLeft = () => {
      $router.go(-1);
    };

    return {
      ...toRefs(data),
      onClickLeft,
      loading,
    };
  },
};
</script>
<style lang="scss" scoped>
.scroll-wrapper {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  top: 0;
  -webkit-overflow-scrolling: touch;
  overflow-y: auto;
}
.scroll-wrapper iframe {
  height: 100%;
  width: 100%;
}
.iframe {
  width: 100%;
  height: 100%;
}
</style>